package com.mida.dms.knw.api;

import com.mida.dms.knw.entity.vo.KnwNoumenonRelationVo;
import com.mida.dms.knw.entity.vo.KnwNoumenonVo;
import com.mida.dms.knw.entity.vo.MapperPage;
import com.mida.dms.knw.vo.KnwNoumenonRelationPageVo;
import com.mida.dms.knw.vo.PageResultVo;
import com.mida.tool.common.result.ActionResult;
import com.mida.tool.common.result.ListResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.DependsOn;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <h1>本体关系对外服务</h1>
 * <p>
 *
 * </p>
 *
 * @author jian.li on 2021/6/22 11:38
 */
@DependsOn("loadFromDatabasePropertyConfig")
@FeignClient(name = "knwNoumenonApi", url = "dms.knw.feign.url")
//@FeignClient(name = "knwNoumenonApi", url = "${dms.knw.feign.url}")
public interface KnwNoumenonRelationApi {

    @ApiOperation(value = "新增关系", notes = "新增关系")
    @PostMapping(value = "/knwNoumenonRelation/addRelation", consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ActionResult add(@RequestBody KnwNoumenonRelationVo relation);

    @ApiOperation(value = "分页查询本体关系", notes = "分页查询本体关系")
    @PostMapping(value = "/knwNoumenonRelation/findPage", consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ListResult<PageResultVo<KnwNoumenonRelationVo>> findPage(@RequestBody KnwNoumenonRelationPageVo vo);

    @ApiOperation(value = "启用本体关系", notes = "启用本体关系")
    @PutMapping(value = "/knwNoumenonRelation/enable", consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"})
    ActionResult enable(@RequestParam(value = "soid") Long soid);

    @ApiOperation(value = "源本体目标本体下拉", notes = "源本体目标本体下拉")
    @PostMapping(value = "/knwNoumenonRelation/findDataBySource", consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ListResult<List<KnwNoumenonVo>> findSourceAndTarget(@RequestBody MapperPage knwNoumenon);

    @ApiOperation(value = "关系下拉(从概念域获取)", notes = "关系下拉(从概念域获取)")
    @GetMapping(value = "/knwNoumenonRelation/findRelation", consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ListResult<Object> findRelation(@RequestParam(value = "searchData") String searchData);

    @ApiOperation(value = "编辑本体关系", notes = "编辑实例关系")
    @PostMapping(value = "/knwNoumenonRelation/updateRelation", consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ActionResult updateSingle(@RequestBody KnwNoumenonRelationVo relation);

    @ApiOperation(value = "删除本体关系", notes = "删除实例关系")
    @GetMapping(value = "/knwNoumenonRelation/delete", produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ActionResult delete(@RequestParam("soid") Long soid);
}
